[#escape x as (x)!?html]
<nav class="navbar navbar-expand navbar-light[#if headerShadow!false] shadow-sm[/#if] border-bottom cm-navbar">
  <div class="container flex-column flex-xl-row justify-content-start align-items-stretch align-items-xl-center px-lg-3">
    <div class="d-flex align-items-center">
      <div class="flex-grow-1">
        <a class="navbar-brand" href="${site.url}" title="${site.name}"><img src="${site.logo!'${files}/img/logo.png'}" alt="${site.name}" height="50"></a>
      </div>
      <button class="btn d-xl-none collapsed p-0" type="button" data-toggle="collapse" data-target="#navbarNavDropdown"
              aria-controls="navbarNavDropdown" aria-expanded="false" aria-label="Toggle navigation">
        <svg xmlns="http://www.w3.org/2000/svg" width="30" height="30" viewBox="0 0 30 30" focusable="false">
          <path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path>
        </svg>
      </button>
    </div>
    <div class="navbar-nav-scroll mr-auto">
      <ul class="navbar-nav flex-row">
        <li class="nav-item">
          <a class="nav-link[#if isHome??] active[/#if]" href="${dy}/">首页</a>
        </li>
        [@ChannelList isNav='true' offset='0'; list]
          [#list list as item]
            <li class="nav-item">
              <a class="nav-link[#if channel?? && channel.paths[0].id == item.id] active[/#if]" href="${item.url}"[#if item.targetBlank] target="_blank"[/#if]>${item.name}</a>
            </li>
          [/#list]
        [/@ChannelList]
      </ul>
    </div>
    [@Site id='2'; bean][#if bean??]<div class="mr-3"><a href="${bean.url}" class="small">EN</a></div>[/#if][/@Site]
    <div class="collapse d-xl-block mt-1 mt-xl-0" id="navbarNavDropdown">
      <form action="${dy}/search">
        <div class="input-group">
          <input type="text" class="form-control" id="q" name="q" value="${Params.q}" placeholder="搜索" aria-label="搜索">
          <div class="input-group-append">
            <button class="btn btn-outline-secondary" type="submit">
              <svg width="1em" height="1em" viewBox="0 0 16 16" class="bi bi-search" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
                <path fill-rule="evenodd" d="M10.442 10.442a1 1 0 0 1 1.415 0l3.85 3.85a1 1 0 0 1-1.414 1.415l-3.85-3.85a1 1 0 0 1 0-1.415z"></path>
                <path fill-rule="evenodd" d="M6.5 12a5.5 5.5 0 1 0 0-11 5.5 5.5 0 0 0 0 11zM13 6.5a6.5 6.5 0 1 1-13 0 6.5 6.5 0 0 1 13 0z"></path>
              </svg>
            </button>
          </div>
        </div>
      </form>
    </div>
  </div>
</nav>
[/#escape]
